package Test;

import java.util.Arrays;

public class test05 {
    public static boolean IsContinuous (int[] numbers) {
        // write code here
        Arrays.sort(numbers);
        int count = 0;
        while(count<5 && numbers[count]==0){
            count++;
        }
        if(count>=4) return true;
        int ret = numbers[4]-numbers[count]-1;
        if(ret<=count) return true;
        if(ret>3) return false;
        for(int i=count+1;i<4;i++){
            if(numbers[i]==numbers[i-1]
                    || numbers[i]<=numbers[count] || numbers[i]>=numbers[4])
                return false;
        }
        return true;

    }

    public static void main(String[] args) {
        int[] arr= {1,2,3,4,6};
        boolean b = IsContinuous(arr);
        System.out.println(b);
    }

}
